package study.designpattern.mediator;

import java.awt.event.ActionListener;

import javax.swing.JButton;

public class BtnSearch extends JButton implements Command{
    IMediator med;
    
    
    public BtnSearch(ActionListener al, IMediator med) {
        super("search");
        this.med = med;
        addActionListener(al);
        med.registerSearch(this);
    }


    @Override
    public void execute() {
        med.search();
    }

}
